import 'dart:async';

import 'package:flutter/material.dart';
import 'package:mine_sweeping/game_setting.dart';

class PlayTime extends StatefulWidget {
  const PlayTime({Key? key}) : super(key: key);

  @override
  State<PlayTime> createState() => _PlayTimeState();
}

class _PlayTimeState extends State<PlayTime> {
  GameSetting gameSetting = GameSetting();
  late Timer timer;

  @override
  void initState() {
    super.initState();
    timer = Timer.periodic(Duration(seconds: 1), (timer) {
      setState(() {
        gameSetting.incrementPlayTime = 1;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return Text(gameSetting.playTime);
  }
}
